<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>pthread_mutex_setprioceiling</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_007_1450">&nbsp;</a>NAME</h4><blockquote>
pthread_mutex_setprioceiling, pthread_mutex_getprioceiling
- change the priority ceiling of a mutex
(<b>REALTIME THREADS</b>)
</blockquote><h4><a name = "tag_000_007_1451">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="pthread.h.html">pthread.h</a>&gt;

int pthread_mutex_setprioceiling(pthread_mutex_t *<i>mutex</i>,
    int <i>prioceiling</i>, int *<i>old_ceiling</i>);
int pthread_mutex_getprioceiling(const pthread_mutex_t *<i>mutex</i>,
    int *<i>prioceiling</i>);
</code>
</pre>
</blockquote><h4><a name = "tag_000_007_1452">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>pthread_mutex_getprioceiling()</i>
function returns the current priority ceiling of the mutex.
<p>
The
<i>pthread_mutex_setprioceiling()</i>
function either locks the mutex if it is unlocked, or blocks until it can
successfully lock the mutex, then it
changes the mutex's priority ceiling and releases the mutex.
When the change is successful, the previous value of the
priority ceiling is returned in
<i>old_ceiling</i>.
The process of locking the mutex need not adhere
to the priority protect protocol.
<p>
If the
<i>pthread_mutex_setprioceiling()</i>
function fails, the mutex priority ceiling is not changed.
</blockquote><h4><a name = "tag_000_007_1453">&nbsp;</a>RETURN VALUE</h4><blockquote>
If successful, the
<i>pthread_mutex_setprioceiling()</i>
and
<i>pthread_mutex_getprioceiling()</i>
functions return zero.
Otherwise, an error number is returned to indicate the error.
</blockquote><h4><a name = "tag_000_007_1454">&nbsp;</a>ERRORS</h4><blockquote>
The 
<i>pthread_mutex_getprioceiling()</i>
and
<i>pthread_mutex_setprioceiling()</i>
functions will fail if:
<dl compact>

<dt>[ENOSYS]<dd>
The option _POSIX_THREAD_PRIO_PROTECT is not defined and
the implementation does not support the function.

</dl>
<p>
The
<i>pthread_mutex_setprioceiling()</i>
and
<i>pthread_mutex_getprioceiling()</i>
functions may fail if:
<dl compact>

<dt>[EINVAL]<dd>
The priority requested by
<i>prioceiling</i>
is out of range.

<dt>[EINVAL]<dd>The value specified by
<i>mutex</i>
does not refer to a currently existing mutex.

<dt>[ENOSYS]<dd>
The implementation does not support the priority ceiling protocol for mutexes.

<dt>[EPERM]<dd>
The caller does not have the privilege to perform the operation.

</dl>
</blockquote><h4><a name = "tag_000_007_1455">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_007_1456">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_007_1457">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_007_1458">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="pthread_mutex_init.html">pthread_mutex_init()</a></i>,
<i><a href="pthread_mutex_lock.html">pthread_mutex_lock()</a></i>,
<i><a href="pthread_mutex_unlock.html">pthread_mutex_unlock()</a></i>,
<i><a href="pthread_mutex_trylock.html">pthread_mutex_trylock()</a></i>,
<i><a href="pthread.h.html">&lt;pthread.h&gt;</a></i>.
<br>
</blockquote><h4>DERIVATION</h4><blockquote>
Derived from the POSIX Threads Extension (1003.1c-1995)
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>

